package com.javatest.springbootactivemq2.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2019-12-03 上午10:37
 */
@Slf4j
@Component
public class TopicConsummer {
    @JmsListener(destination = "${mytopic}")
    public void receive(TextMessage message) throws JMSException {
        log.info("**************消费者收到订阅主题消息:" + message.getText());
    }
}
